def generater_func():
    """获取所有质数"""
    i = 2
    yield i
    while True:
        i = i + 1
        for j in range(2,i):
            if(i % j == 0): # 如果可以被别的整数整除，则不是质数
                break
        else: # 不可以被别的整数整除 是质数，返回
            yield i

if __name__ == '__main__':
    g = generater_func()
    num = next(g) # 获取一个质数
    while num < 100:
        print(num)
        num = next(g)